package org.linlinjava.litemall.admin.web2.user.resp;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.linlinjava.litemall.db.domain.TShopApply;
import org.linlinjava.litemall.db.domain.TUserInfo;
import org.linlinjava.litemall.db.enumeration.Const;

@ApiModel
public class UResp2 {

    @ApiModelProperty("id")
    private Integer id;
    @ApiModelProperty("申请成为")
    private String type;
    @ApiModelProperty("申请成为code")
    private Integer typeCode;
    @ApiModelProperty("头像")
    private String img;
    @ApiModelProperty("微信号")
    private String wx;
    @ApiModelProperty("姓名")
    private String name;
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("邀请码(推荐人)")
    private String code;
    @ApiModelProperty("店铺名称")
    private String shopName;
    @ApiModelProperty("地址")
    private String shopAddress;
    @ApiModelProperty("资质")
    private String pic1;
    @ApiModelProperty("其他资质")
    private String pic2;
    @ApiModelProperty("申请和修改")
    private String applyNum;
    @ApiModelProperty("状态")
    private String status;
    @ApiModelProperty("状态int")
    private Integer statusCode;

    public UResp2() {
    }

    public UResp2(TShopApply apply, TUserInfo userInfo) {
        id = apply.getId();
        if (userInfo != null) {
            img = userInfo.getAvatar();
            wx = userInfo.getNickname();
        }

        if (apply != null) {
            type = Const.Identity.value(apply.getType());
            typeCode = apply.getType();
            name = apply.getContactsName();
            phone = apply.getPhone();
            code = apply.getCode();
            shopName = apply.getCommunityName();
            shopAddress = apply.getDetailAddress();
            pic1 = apply.getLicense();
            pic2 = apply.getOtherLicense();
            applyNum = "第" + apply.getApplyNum() + "次申请";
            status = Const.APPLY_STATUS.value(apply.getStatus());
            statusCode = apply.getStatus();
        }
    }


    public Integer getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(Integer typeCode) {
        this.typeCode = typeCode;
    }

    public Integer getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(Integer statusCode) {
        this.statusCode = statusCode;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getWx() {
        return wx;
    }

    public void setWx(String wx) {
        this.wx = wx;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopAddress() {
        return shopAddress;
    }

    public void setShopAddress(String shopAddress) {
        this.shopAddress = shopAddress;
    }

    public String getPic1() {
        return pic1;
    }

    public void setPic1(String pic1) {
        this.pic1 = pic1;
    }

    public String getPic2() {
        return pic2;
    }

    public void setPic2(String pic2) {
        this.pic2 = pic2;
    }

    public String getApplyNum() {
        return applyNum;
    }

    public void setApplyNum(String applyNum) {
        this.applyNum = applyNum;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
